
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>基础</title>
</head>
<body >
<canvas id="canvas" style="display: block;margin: 0 auto;border: 1px solid #aaa">
    您的浏览器不支持canvas
</canvas>
<script>
    window.onload=function(){
        var canvas=document.getElementById("canvas");
        canvas.width=1024;
        canvas.height=768;
        var context=canvas.getContext("2d");

        context.beginPath();
        context.moveTo(150,150);
        context.arcTo(650,150,650,650,300);

        context.lineWidth=5;
        context.strokeStyle="red";
        context.stroke();

        //baseline
        context.beginPath();
        context.moveTo(150,150);
        context.lineTo(650,150);
        context.lineTo(650,650);

        context.lineWidth=2;
        context.strokeStyle="gray";
        context.stroke();


    }
</script>
</body>
</html>